package nl.hu.modellingengine.ribbon.client;

import nl.hu.modellingengine.client.ClientFactory;
import nl.hu.modellingengine.ribbon.client.activity.RibbonActivityMapper;

import com.google.gwt.activity.shared.ActivityManager;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.SimplePanel;

public class Ribbon {
	
	private SimplePanel appWidget = new SimplePanel();
	
	public Ribbon(RootPanel containerPanel,ClientFactory clientFactory){
		EventBus eventBus = clientFactory.getEventBus();
		RibbonFactory ribbonFactory = GWT.create(RibbonFactory.class);
		
		  // Start ActivityManager for the main widget with our ActivityMapper
        ActivityMapper activityMapper = new RibbonActivityMapper(clientFactory,ribbonFactory);
        ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
        activityManager.setDisplay(appWidget);
        containerPanel.add(appWidget);
	}
}
